

#ifndef __I_FILE_H__
#define __I_FILE_H__


#include <cecore/iqf.h>
#include <cecore/cetypes.h>


struct iFile : public virtual iBase
{
	enum SeekPos
	{
		SP_Set,
		SP_Cur,
		SP_End,
	};

	enum OpenMode
	{
		OM_Read						= 0x01,
		OM_Write					= 0x02,
		OM_Append					= 0x04,
		OM_Text						= 0x08,
		OM_ReadWrite =		OM_Read | OM_Write,
	};

	IQF_INTERFACE(iFile);

	virtual bool Open (int mode) = 0;
	virtual bool IsOpen () const = 0;
	virtual void Close () = 0;

	virtual size_t Write (const void* src, size_t size) = 0;
	virtual size_t Write (const ceString& text) = 0;

	virtual size_t Read (void* data, size_t size) = 0;

	virtual void Seek (SeekPos pos, long offset = 0) = 0;

	virtual long Tell () const = 0;
};

#endif /*!  __I_FILE_H__ */
